home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / termsorc.lha / Extras / Source / gtlayout-source.lha / LT_Activate.c < prev    next >
C/C++ Source or Header  |  1995-09-24  |  829b  |  38 lines

  1. /*  GadTools layout toolkit
  2. **
  3. **  Copyright © 1993-1995 by Olaf `Olsen' Barthel
  4. **  Freely distributable.
  5. */
  6.  
  7. #include "gtlayout_global.h"
  8.  
  9. VOID LIBENT
  10. LT_Activate(REG(a0) LayoutHandle *handle,REG(d0) LONG id)
  11. {
  12.     struct Gadget *gadget;
  13.  
  14.     if(gadget = LTP_FindGadget(handle,id))
  15.     {
  16.         ObjectNode *node;
  17.  
  18.         if(GETOBJECT(gadget,node))
  19.         {
  20.             if(!node -> Disabled)
  21.             {
  22.                 if(LIKE_STRING_KIND(node) || (node -> Type == INTEGER_KIND) || (node -> Type == BOOPSI_KIND && node -> Special . BOOPSI . ActivateHook))
  23.                 {
  24.                     handle -> Previous = gadget;
  25.  
  26.                     if(node -> Type == BOOPSI_KIND)
  27.                     {
  28.                         if(node -> Special . BOOPSI . ActivateHook)
  29.                             CallHookPkt(node -> Special . BOOPSI . ActivateHook,(APTR)handle,node -> Host);
  30.                     }
  31.                     else
  32.                         ActivateGadget(handle -> Previous,handle -> Window,NULL);
  33.                 }
  34.             }
  35.         }
  36.     }
  37. }
  38.